package com.yong.opengl.ui

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.yong.opengl.R
import com.yong.opengl.ui.draw_img.DrawImgRender
import kotlinx.android.synthetic.main.activity_gl_surface_view.*

/**
 * @Description: 绘制一张图片
 * @Author:         yong
 * @time            2021/3/31 0031 10:16
 * @version         1.0
 */
class DrawImgActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_gl_surface_view)

        //view初始化
        initView()
    }

    private fun initView() {
        //设置openGl版本(当前版本为3)
        glSurfaceView.setEGLContextClientVersion(3)
        //初始化渲染器
        val drawImgRender = DrawImgRender(this)
        //glSurfaceView设置渲染器
        glSurfaceView.setRenderer(drawImgRender)
    }
}